class_name ScreenFactory

var screens: Dictionary[SoccerGame.ScreenType, PackedScene]

func _init() -> void:
	screens = {
		SoccerGame.ScreenType.MAIN_MENU: preload("uid://ehiqh72cw6r4"),
		SoccerGame.ScreenType.TEAM_SELECTION: preload("uid://qieajfyiloa5"),
		SoccerGame.ScreenType.IN_GAME: preload("uid://bqlojsjbd2xpi"),
		SoccerGame.ScreenType.TOURNAMENT: preload("uid://xrc3grp1isho")
	}
	
func get_fresh_screen(screen_type: SoccerGame.ScreenType) -> Screen:
	assert(screens.has(screen_type), "screen type no exist!!!")
	return screens.get(screen_type).instantiate()
